<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        * {
            padding: 0;
            margin: 0;
        }
        
        body {
            overflow: hidden;
        }
        
        #son {
            position: absolute;
            width: 50px;
            height: 50px;
            background-color: rebeccapurple;
            right: 0;
            color: white;
            text-align: center;
            line-height: 50px;
            cursor: default;
            bottom: 100px;
        }
        
        #father {
            position: absolute;
            width: 100px;
            height: 50px;
            background-color: red;
            left: 50px;
            bottom: 0px;
        }
    </style>
</head>

<body>
    <div id="son">
        <span><--</span>
        <div id="father">点击</div>
    </div>



</body>
<script src="js/my.js"></script>
<script>
    var son = document.getElementById('son');
    var father = document.getElementById('father');
    var span = document.getElementsByTagName('span');

    son.addEventListener('mouseover', function() {
        animate(father, -100, function() {
            span[0].innerHTML = '-->';
        });
    })
    son.addEventListener('mouseleave', function() {
        animate(father, 50);
        span[0].innerHTML = '<--';
    })
</script>




</html>